<?
/*
***************MainForm******************	
*	Created by Doron Rainer		*
*****************************************
*/
class input extends form {
	private $label,$type,$name,$value,$style;
	
	function input($lab,$typ,$nam,$valu="",$styl="")
	{
		$this->label=$lab;
		$this->type=$typ;
		$this->name=$nam;
		$this->value=$valu;
		$this->style=$styl;
	}

	function add($form)
	{
		$form->insert($this);
	}
	
	function del($form)
	{
		$form->remove($this->name);
	}
	protected function createObject()
	{
		$name = $this->name;
		$type = $this->type;
		$label = $this->label;
		$value = $this->value;
		$style = $this->style;
		if ($type == "text" || $type == "password" || $type == "file" || $type == "hidden") {
			$out.="{$label}: <input type='{$type}' name='{$name}'";
			if ($value != "") {
				$out.= "value='{$value}'";
			}
			if ($style != "") {
				$out .="style='{$style}'";
			}
			$out .=">\n";
		}
		if ($type == "checkbox" || $type == "radio")
		{
			$out.="<input type='{$type}' name='{$name}'";
			if ($style != "") {
				$out .="style='{$style}'";
			}
			if ($value != "") {
				$out .= " checked";
			}
				$out .=">{$label}\n";
			}
			if ($type == "submit" || $type == "button" || $type == "reset" ||  $type == "image") {
				$out.="<input type='{$type}' value='$value'";
				if ($style != "") {
					$out .="style='{$style}'";
				}
			$out .=">\n";
		}
		return $out;
				
	}
	function getType()
	{
		return $this->type;
	}
	function getLabel()
	{
		return $this->label;
	}
	function getStyle()
	{
		return $this->style;
	}
	function getValue()
	{
		return $this->value;
	}
	function getName()
	{
		return $this->name;
	}
	
	//Sets
	function setType($type)
	{
		$this->type=$type;
	}
	function setLabel($label)
	{
		$this->label=$label;
	}
	function setStyle($style)
	{
		$this->style=$style;
	}
	function setValue($value)
	{
		$this->value=$value;
	}
	function setName($name)
	{
		$this->name=$name;
	}

}
?>
